import 'package:banquanjie_app/app/services/screenAdapter.dart';
import 'package:flutter/material.dart';
class CompanyCard extends StatelessWidget {
  final Map item;
  const CompanyCard({super.key, required this.item});
  @override
  Widget build(BuildContext context) {
    return Container(
      padding: EdgeInsets.only(left: ScreenAdapter.width(20), top: ScreenAdapter.height(20), bottom: ScreenAdapter.height(20)),
      width: ScreenAdapter.width(710),
      // height: ScreenAdapter.height(160),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.all(Radius.circular(8)),
      ),
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          Container(
            margin: EdgeInsets.only(right: ScreenAdapter.width(16)),
            width: ScreenAdapter.width(108),
            height: ScreenAdapter.width(108),
            child:  Stack(
              children: [
                //  <image class="cover" mode="aspectFill" :src="item.headOssUrl"></image>
            // <image class="auth_icon" src=""></image>
                ClipOval(
                  child: Image.network(
                    item['headOssUrl'],
                    width: ScreenAdapter.width(108),
                    height: ScreenAdapter.width(108),
                    fit: BoxFit.cover
                  )
                ),
                Align(
                  alignment: Alignment(1, 1),
                  child: ClipRRect(
                    child: Image.network(
                      'https://zsjl.oss-cn-beijing.aliyuncs.com/test/xcx/auth_icon.png',
                      width: ScreenAdapter.width(30),
                      height: ScreenAdapter.width(30),
                      fit: BoxFit.cover
                    )
                  )
                )
              ]
            ),
          ),
          Expanded(
            flex: 1,
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Text('${item['entName']}', style: TextStyle(height: 48 / 28,fontSize: ScreenAdapter.fontSize(28), color: Color(0xFF080808))),
                SizedBox(height: ScreenAdapter.height(10)),
                Row(
                  children: [
                    
                    Container(
                      height: ScreenAdapter.fontSize(24) * (13 / 12),
                      // alignment: Alignment.center,
                      margin: EdgeInsets.only(right: ScreenAdapter.width(6)),
                      padding: EdgeInsets.symmetric(horizontal: ScreenAdapter.width(4)),
                      // constraints: BoxConstraints(
                      //   minWidth: ScreenAdapter.width(58),
                      //   // maxWidth: ScreenAdapter.width(58)
                      // ),
                      decoration: BoxDecoration(
                        color: Color(0xFFD9F4EB),
                        borderRadius: BorderRadius.circular(ScreenAdapter.width(4)),
                      ),
                      clipBehavior: Clip.antiAlias,
                      child: Text(
                        '${item['brandTypeName']}', 
                        overflow: TextOverflow.ellipsis, 
                        maxLines: 1, 
                        style: TextStyle(
                          height: 13 / 12, 
                          fontSize: ScreenAdapter.fontSize(24), 
                          color: Color(0xFF666666)
                        )
                      )
                    )
                  ]
                ),
                SizedBox(height: ScreenAdapter.height(8)),
                RichText(
                  // strutStyle: StrutStyle(
                  //   height: 1.9,      // 行高倍数
                  //   leading: 0,     // 额外间距
                  //   forceStrutHeight: true, // 强制应用行高
                  // ),
                  text: TextSpan(
                    style: TextStyle(
                      height: 1.9,
                      fontSize: ScreenAdapter.fontSize(22), 
                      color: Color(0xFF999999),
                      leadingDistribution: TextLeadingDistribution.even
                    ),
                    children: [
                      WidgetSpan(
                        alignment: PlaceholderAlignment.middle,
                        child: Image.network(
                          'https://zsjl.oss-cn-beijing.aliyuncs.com/test/xcx/love_icon.png',
                          width: ScreenAdapter.width(20),
                          height: ScreenAdapter.width(18),
                          fit: BoxFit.cover
                        )
                      ),
                      TextSpan(text: "${item['cityName']}"),
                    ]
                  )
                )


              ]
            )
          )
        ]
      )
    );
  }
  
}